package com.spzx.user.mapper;

import java.util.List;
import com.spzx.user.domain.Region;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

/**
 * 地区信息Mapper接口
 *
 * @author atguigu
 * @date 2024-07-03
 */
public interface RegionMapper extends BaseMapper<Region>
{

    /**
     * 查询地区信息列表
     *
     * @param region 地区信息
     * @return 地区信息集合
     */
    public List<Region> selectRegionList(Region region);
    @Select("select concat(r3.name, r2.`name` ,r1.`name` )\n" +
            "from region r1 \n" +
            "join region r2 on r1.parent_code = r2.code \n" +
            "join region r3 on r2.parent_code = r3.code \n" +
            "where r1.code = #{districtCode}")
    String selectLevel123NameByCode(String districtCode);
}
